# 导入蓝图
from flask import Blueprint
from flask import request, jsonify
from dao import bank_dao

# 生成一个蓝图对象
blue = Blueprint("bankBlue", __name__)


@blue.route('/bank', methods=['GET', 'POST'])
def bank():
    dao = bank_dao.BankDao()
    data = dao.find_all()   # list
    return jsonify({
        "status": 200,
        "message": "find all OK",
        "data": data
    })


@blue.route('/delbank', methods=['GET'])
def del_bank():
    bank_id = request.args.get("id")
    return "<h3>正在删除银行：%s</h3>" % bank_id
